package microarray;

import java.io.IOException;
import java.util.LinkedList;

public class DataCompare {
	
	EFetch  fetchOne;
	EFetch  fetchTwo;
	LinkedList<RawData> rawOne;
	LinkedList<RawData> rawTwo;
		public DataCompare(EFetch fetchOne, EFetch fetchTwo)
		{
			this.fetchOne = fetchOne;
			this.fetchTwo = fetchTwo;
			rawOne = new LinkedList<RawData>();
			rawTwo = new LinkedList<RawData>();
		}
		
		public void compare()
		{
			
			for (DataSeries ds : fetchOne.dataSeries)
			{
				System.err.println("adding...");
				try {
					Platform platform = Platform.getPlatform(ds.getPlatform());
					for (String gds : ds.getSamples()){
						rawOne.add(new RawData(gds, platform));
						System.err.println("added "+ gds);
					}
				} catch (Exception e) {e.printStackTrace();}
			}
			
			for (DataSeries ds : fetchTwo.dataSeries)
			{
				try{
					Platform platform = Platform.getPlatform(ds.getPlatform());
					for (String gds : ds.getSamples())
						rawTwo.add(new RawData(gds, platform));
				} catch (Exception e) {e.printStackTrace();}
			}

		}
		
		public String toString()
		{
			return rawOne.size() + "";
		}
}
